<?php

// Europa 100 AD
//
//

echo '<h1>Developer Login</h1>';
echo '<p>Please note login is currently only enabled for developers and private beta members. The public launch beta won\'t be until <b>October 2007</b>.</p>';

echo '<p><small><b>Warning: Any page previewing software you have installed in your browser (eg Cooliris) MUST be disabled for this site.</b></small></p>';


$login_form = " 
    Private login below...<br>
    <FORM METHOD=POST name=dev_login ACTION=\"index.php\"> 
    email: <INPUT TYPE=TEXT NAME=email VALUE=\"\">
    <INPUT TYPE=hidden NAME=remove VALUE=\"1\"> <br><br>
    <INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Remove this address\"> 
    </FORM>
";

?>

<form action="" name="recaptcha" method="post">
Email: <input type="text" name="e"><br><br>
Password: <input type="text" name="p"><br><br>
<?php

require_once($config['dir_inc'] . 'recaptcha.inc.php');
new recaptcha;

# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$error = null;

# are we submitting the page?
if (@$_POST["submit"]) {
  $resp = recaptcha_check_answer ($privatekey,
                                  $_SERVER["REMOTE_ADDR"],
                                  $_POST["recaptcha_challenge_field"],
                                  $_POST["recaptcha_response_field"]);

  if ( 1 ) { //$resp->is_valid) {
    $email = $_REQUEST['e'];
    $password = $_REQUEST['p'];
    $login_test = $user->login($email,$password);
    if (strlen($login_test) == $config['uid_length']){
        // forward the person on to their home
        echo 'logging in...';
        header("Location: http://localhost/~kevindougans/europa100ad.com/ceaser/en/$login_test/home/");
    } else {
        // do nothing, let user fill in login again.
    }
  } else {
    # set the error code so that we can display it. You could also use
    # die ("reCAPTCHA failed"), but using the error message is
    # more user friendly
    $error = $resp->error;
  }
}
echo recaptcha_get_html($publickey, $error);
?>
    <br/>
    <input type="submit" name="submit" value="submit" />
    </form>